package jwxx.json;

import java.util.ArrayList;

import jwxx.json.src.GsonPlayerOnLine;

import com.google.gson.annotations.Expose;

public class PlayerListNearBy extends GsonBase implements Cloneable {

	/**
	 * 
	 */

	public class PlayerOnLine extends GsonPlayerOnLine implements Cloneable 
	{

		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		
	}
	private static final long serialVersionUID = -8053842703386919220L;
	@Expose
	private int selfID;
	@Expose
	private String selfName;
	@Expose
	private double latitude;
	@Expose
	private double longitude;
	@Expose
	public ArrayList<PlayerOnLine> playerList;
	
	public PlayerListNearBy()
	{
		//GsonBase rely on this func
		setJsonType(PlayerListNearBy.class.getName());

		playerList = new ArrayList<PlayerOnLine>();
	}

	public PlayerListNearBy(int num)
	{
		//GsonBase rely on this func
		setJsonType(PlayerListNearBy.class.getName());

		playerList = new ArrayList<PlayerOnLine>();
		for(int i = 0; i< num ; ++i)
		{
			PlayerOnLine player = new PlayerOnLine();
			playerList.add(player);
		}
		
	}

	//GsonBase rely on this func
	public static Object InitFromJson(String JsonString)
	{
		return InitFromJson(JsonString,PlayerListNearBy.class);	
	}
	
	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public String getSelfName() {
		return selfName;
	}

	public void setSelfName(String selfName) {
		this.selfName = selfName;
	}

	public int getSelfID() {
		return selfID;
	}

	public void setSelfID(int selfID) {
		this.selfID = selfID;
	}

}
